﻿//-----------------------------------------------------------------------
// <copyright file="PublishedFaultExceptionOfT.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Silverlight
{
    using System;

    using System.Security;
    using System.Security.Permissions;

    using System.ServiceModel;
    using System.ServiceModel.Channels;

    /// <summary>
    /// Represents a SOAP fault that has been successfully published.
    /// </summary>
    /// <typeparam name="T">The serializable error detail type.</typeparam>
    public class PublishedFaultException<T> : FaultException<T>, IPublishedException
    {
        #region public PublishedFaultException(Guid publicationId, T detail, FaultReason reason, FaultCode code, string action) : base(detail, reason, code, action)

        /// <summary>
        /// Initializes a new instance of the <see cref="T:PublishedFaultException`1"/> class that uses the specified detail object.
        /// </summary>
        /// <param name="publicationId">The publication id.</param>
        /// <param name="detail">The object used as the SOAP fault detail.</param>
        /// <param name="reason">The reason for the SOAP fault.</param>
        /// <param name="code">The fault code for the SOAP fault.</param>
        /// <param name="action">The action of the SOAP fault.</param>
        public PublishedFaultException(Guid publicationId, T detail, FaultReason reason, FaultCode code, string action) : base(detail, reason, code, action)
        {
            this.PublicationId = publicationId;
        }

        #endregion

        #region public Guid PublicationId

        /// <summary>
        /// Gets the publication Id associated with the fault.
        /// </summary>
        public Guid PublicationId
        {
            get;
            private set;
        }

        #endregion
    }
}
